<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="css/app.css"/>
		<style type="text/css">
			*{background: initial;}
			.mui-segmented-control .mui-control-item.mui-active{background:#FF8D01;}
			.mui-segmented-control{border:1px #FF8D01 solid;}
			.mui-segmented-control .mui-control-item{border: none;color: #FF8D01;background: white;}
			.mui-segmented-control.mui-scroll-wrapper .mui-scroll{background: white;}
			.mui-bar-nav~.mui-content .mui-slider.mui-fullscreen{padding-top: 20px;box-sizing: border-box;}
			.mui-slider-indicator{width: 94%;margin: 0 auto;}
			.mui-segmented-control.mui-scroll-wrapper .mui-scroll{width: 100%;}
			.mui-segmented-control.mui-scroll-wrapper .mui-control-item{width: 50%;}
			.mui-fullscreen .mui-segmented-control~.mui-slider-group{top: 60px;}
			#slider{background: #FFFFFF;}
			.listBlock span{display: block;line-height: 25px;}
			.listBlock span:nth-of-type(1){color: #333333;font-size: 18px;}
			.listBlock span:nth-of-type(2){color: #666666;font-size: 14px;}
			.listBlockNext{line-height: 50px;color: #015EFF;font-size: 18px;}
			.listBlock,.listBlockNext{margin-top: 5px;}
			.mui-table-view{margin: 15px;box-sizing: border-box;}
			.mui-table-view-cell{height: 78px;}		
			.detailColorGreen{color: #3FD11C;}
			.detailColorRed{color: #F24141;}
				
			/*下拉刷新样式*/
			 .mui-pull-top-tips {
                position: absolute;
                top: -20px;
                left: 50%;
                margin-left: -25px;
                width: 40px;
                height: 40px;
                border-radius: 100%;
                z-index: 1;
            }
            .mui-pull-top-wrapper {
                width: 42px;
                height: 42px;
                display: block;
                text-align: center;
                background-color: #efeff4;
                border: 1px solid #ddd;
                border-radius: 25px;
                background-clip: padding-box;
                box-shadow: 0 4px 10px #bbb;
                overflow: hidden;
            }
            .mui-pull-top-tips.mui-transitioning {
                -webkit-transition-duration: 200ms;
                transition-duration: 200ms;
            }
            .mui-pull-top-canvas canvas {
                width: 40px;
            }
            .mui-slider-indicator.mui-segmented-control {
                background-color: #efeff4;
            }
            .mui-pull-bottom-wrapper span{width:100%;display:block;text-align: center;height: 40px; line-height: 40px;}
            .mui-pull-bottom-tips{border-top: 1px #eee solid;}
		</style>
	</head>
	<body>
		<header class="mui-bar mui-bar-nav colorful">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">我的明细</h1>
		</header>
		<!--没有明细-->
		<!--<div class="mui-content">
		    <div class="mui-content-padded">
		    	<div class="repayment">
					<img src="image/icon_stateless.png"/>
					<p>暂无明细哦</p>
				</div>
		    </div>
		</div>-->
		<!--有明细-->
		<div class="mui-content">
			<div class="mui-content-padded">
				<div id="slider" class="mui-slider mui-fullscreen">
					<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control">
						<div class="mui-scroll">
							<a class="mui-control-item mui-active" href="#item1">
								借款记录
							</a>
							<a class="mui-control-item" href="#item3">
								还款记录
							</a>
						</div>
					</div>
					<div class="mui-slider-group">
						<div id="item1" class="mui-slider-item mui-control-content mui-active">
							<div id="scroll1" class="mui-scroll-wrapper">
								<div class="mui-scroll">
									<ul class="mui-table-view">
								        <li class="mui-table-view-cell">
								            <a>
								                <p class="mui-pull-left listBlock"><span>8000.00</span><span>2018年9月16日</span></p>
												<p class="mui-pull-right listBlockNext">已借出</p>
								            </a>
								        </li>
								        <li class="mui-table-view-cell">
								            <a>
								                <p class="mui-pull-left listBlock"><span>8000.00</span><span>2018年9月16日</span></p>
												<p class="mui-pull-right listBlockNext">已借出</p>
								            </a>
								        </li>
								        <li class="mui-table-view-cell">
								            <a>
								                <p class="mui-pull-left listBlock"><span>8000.00</span><span>2018年9月16日</span></p>
												<p class="mui-pull-right listBlockNext">已借出</p>
								            </a>
								        </li>
								    </ul>
								</div>
							</div>
						</div>
						<div id="item3" class="mui-slider-item mui-control-content">
							<div id="scroll1" class="mui-scroll-wrapper">
								<div class="mui-scroll">
									<ul class="mui-table-view">
										<li class="mui-table-view-cell">
								            <a>
								                <p class="mui-pull-left listBlock"><span>599.00</span><span>2018年9月16日</span></p>
												<p class="mui-pull-right listBlockNext detailColorGreen">已还款</p>
								            </a>
								        </li>
								        <li class="mui-table-view-cell">
								            <a>
								                <p class="mui-pull-left listBlock"><span>599.00</span><span>2018年9月16日</span></p>
												<p class="mui-pull-right listBlockNext detailColorRed">逾期</p>
								            </a>
								        </li>
								        <li class="mui-table-view-cell">
								            <a>
								                <p class="mui-pull-left listBlock"><span>599.00</span><span>2018年9月16日</span></p>
												<p class="mui-pull-right listBlockNext detailColorGreen">已还款</p>
								            </a>
								        </li>
									</ul>
								</div>
							</div>
						</div>
					</div>
					
				</div>
			</div>
		</div>
		<script src="js/mui.min.js"></script>
		<script src="http://dcloud.io/hellomui/js/mui.pullToRefresh.js" type="text/javascript" charset="utf-8"></script>
		<script src="http://dcloud.io/hellomui/js/mui.pullToRefresh.material.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
				mui.init();
				(function($) {
					//阻尼系数
					var deceleration = mui.os.ios?0.003:0.0009;
					$('.mui-scroll-wrapper').scroll({
						bounce: false,
						indicators: true, //是否显示滚动条
						deceleration:deceleration
					});
					$.ready(function() {
						//循环初始化所有下拉刷新，上拉加载。
						$.each(document.querySelectorAll('.mui-slider-group .mui-scroll'), function(index, pullRefreshEl) {
							$(pullRefreshEl).pullToRefresh({
								down: {
									   callback: function() {
										var self = this;
										setTimeout(function() {
											var ul = self.element.querySelector('.mui-table-view');
											ul.insertBefore(createFragment(ul, index, 10, true), ul.firstChild);
											self.endPullDownToRefresh();
										}, 1000);
									}
								},
								up: {
									callback: function() {
										var self = this;
										setTimeout(function() {
											var ul = self.element.querySelector('.mui-table-view');
											ul.appendChild(createFragment(ul, index, 5));
											self.endPullUpToRefresh();
										}, 1000);
									}
								}
							});
						});
						var createFragment = function(ul, index, count, reverse) {
							var length = ul.querySelectorAll('li').length;
							var fragment = document.createDocumentFragment();
							var li;
							for (var i = 0; i < count; i++) {
								li = document.createElement('li');
								li.className = 'mui-table-view-cell';
//								li.innerHTML = '第' + (index + 1) + '个选项卡子项-' + (length + (reverse ? (count - i) : (i + 1)));
								li.innerHTML = '<a>	<p class="mui-pull-left listBlock"><span>599.00</span><span>2018年9月16日</span></p><p class="mui-pull-right listBlockNext detailColorGreen">已还款</p></a>'
								fragment.appendChild(li);
							}
							return fragment;
						};
					});
				})(mui);
		</script>
	</body>

</html>